package hiho.ku._1143;

import java.util.Scanner;

public class Main {
	
	private static final long BIGNUM = 19999997;
	
	private static class Matrix {
		long a, b, c, d;
	}

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		in.close();
		
		Matrix r = new Matrix();
		r.a = 0;
		r.b = r.c = r.d = 1;
		Matrix a = new Matrix();
		a.a = a.d = 1;
		a.b = a.c = 0;
		while (n > 0) {
			if (n % 2 > 0)
				a = multiple(a, r);
			n /= 2;
			r = multiple(r, r);
		}
		System.out.println(a.d);
	}
	
	private static Matrix multiple(Matrix a, Matrix b) {
		Matrix c = new Matrix();
		c.a = (a.a * b.a + a.b * b.c) % BIGNUM;
		c.b = (a.a * b.b + a.b * b.d) % BIGNUM;
		c.c = (a.c * b.a + a.d * b.c) % BIGNUM;
		c.d = (a.c * b.b + a.d * b.d) % BIGNUM;
		return c;
	}

}
